home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / jpl_c.zip / NPROB.C < prev    next >
Text File  |  1986-05-18  |  1KB  |  32 lines

  1. /* 1.0  04-27-84 */
  2. /************************************************************************
  3.  *            Robert C. Tausworthe                *
  4.  *            Jet Propulsion Laboratory            *
  5.  *            Pasadena, CA 91009        1984        *
  6.  ************************************************************************/
  7.  
  8. #include "defs.h"
  9. #include "mathcons.h"
  10.  
  11. /************************************************************************/
  12.     double
  13. nprob(x)        /* Normal probability function, unit variance,
  14.                zero mean, Pr{z <= x}            */
  15. /*----------------------------------------------------------------------*/
  16. {
  17.     double ldexp(), erfc();
  18.  
  19.     return ldexp(erfc(-x / ROOTTWO), -1);
  20. }
  21.  
  22. /************************************************************************/
  23.     double
  24. nprobc(x)        /* Normal probability complement function, unit
  25.                variance, zero mean, Pr{z >= x}        */
  26. /*----------------------------------------------------------------------*/
  27. {
  28.     double erfc();
  29.  
  30.     return ldexp(erfc(x / ROOTTWO) , -1);
  31. }
  32.